﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Skala.master" AutoEventWireup="true" CodeFile="Kategori.aspx.cs" Inherits="Kategori" %>



<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">

   
    <script type="text/javascript">

        function Begen(id, UrunId, hidId) {

            var hidField = '#' + hidId;
            $(hidField).val(UrunId);

            var btnHelper = '#' + id;
            $(btnHelper).trigger("click");
        }

        function CantayaEkle(UrunId, cantaDurumu) {

            var hidUrun = '#' + '<%= hidUrunId.ClientID  %>';
            var hidCanta = '#' + '<%= hidCantaDurumu.ClientID  %>';
            var btnCanta = '#' +  '<%= btnCantayaEkle.ClientID  %>';            

            $(hidUrun).val(UrunId);
            $(hidCanta).val(cantaDurumu);



            $(btnCanta).trigger("click");
        }


        $(document).ready(function () {

            //var kategori = getParameterByName('KategoriId');
            var kategoriArray = getParameterRoutedUrl();
            var kategori = kategoriArray[1];
            $("#kategori" + kategori).toggleClass('Kategori faal-menu');
            var kategoriAdi = $("#kategori" + kategori).attr('Data');

            if (typeof kategoriAdi != 'undefined')
            $(document).attr('title', kategoriAdi+' - SKALA DERİ RESMİ WEB SİTESİ - www.skaladeri.com.tr');

            if (kategoriAdi == 'Clac')
                $("#btncantatipi").hide();
            

            var renk = $("#<%=ddlRenk.ClientID%> option:selected").text();
            if (renk != "Tümü")
                $("#btnRenk").html(renk + '<span class="caret"></span>');

            var desen = $("#<%=ddlDesen.ClientID%> option:selected").text();
            if (desen != "Tümü")
                $("#btnDesen").html(desen + '<span class="caret"></span>');

            var dericesidi = $("#<%=ddlDeriCesidi.ClientID%> option:selected").text();
            if (dericesidi != "Tümü")
                $("#btndericesidi").html(dericesidi + '<span class="caret"></span>');

            var cantatipi = $("#<%=ddlCantaCesidi.ClientID%> option:selected").text();
            if (cantatipi != "Tümü")
                $("#btncantatipi").html(cantatipi + '<span class="caret"></span>');

            var siralama = $("#<%=ddlSiralama.ClientID%> option:selected").text();
            if (siralama != "Sıralama")
                $("#btnsira").html(siralama + '<span class="caret"></span>');

            $(".renk a").click(function () {
                //var x = '#' + $(this).attr('Data');
                //$(x).val = $(this).html();

                $("#<%=ddlRenk.ClientID%>").val(this.id);
                $("#<%=ddlRenk.ClientID%>").trigger("change");                
            });

            $(".desen a").click(function () {

                $("#<%=ddlDesen.ClientID%>").val(this.id);
                $("#<%=ddlDesen.ClientID%>").trigger("change");
            });

            $(".deri a").click(function () {

                $("#<%=ddlDeriCesidi.ClientID%>").val(this.id);
                 $("#<%=ddlDeriCesidi.ClientID%>").trigger("change");
             });

            $(".cantaturu a").click(function () {

                $("#<%=ddlCantaCesidi.ClientID%>").val(this.id);
                $("#<%=ddlCantaCesidi.ClientID%>").trigger("change");
            });

            $(".sira a").click(function () {

                $("#<%=ddlSiralama.ClientID%>").val(this.id);
                $("#<%=ddlSiralama.ClientID%>").trigger("change");
            });

        });

        $(document).ready(function () {
            var kategori = Sys.WebForms.PageRequestManager.getInstance();


            kategori.add_endRequest(function () {
                //var kategori = getParameterByName('KategoriId');
                var kategoriArray = getParameterRoutedUrl();
                var kategori = kategoriArray[1];
                $("#kategori" + kategori).toggleClass('Kategori faal-menu');

                var renk = $("#<%=ddlRenk.ClientID%> option:selected").text();
                if (renk != "Tümü")
                    $("#btnRenk").html(renk + '<span class="caret"></span>');

                var desen = $("#<%=ddlDesen.ClientID%> option:selected").text();
                if (desen != "Tümü")
                    $("#btnDesen").html(desen + '<span class="caret"></span>');

                var dericesidi = $("#<%=ddlDeriCesidi.ClientID%> option:selected").text();
                if (dericesidi != "Tümü")
                    $("#btndericesidi").html(dericesidi + '<span class="caret"></span>');

                var cantatipi = $("#<%=ddlCantaCesidi.ClientID%> option:selected").text();
                if (cantatipi != "Tümü")
                    $("#btncantatipi").html(cantatipi + '<span class="caret"></span>');

                var siralama = $("#<%=ddlSiralama.ClientID%> option:selected").text();
                if (siralama != "Sıralama")
                    $("#btnsira").html(siralama + '<span class="caret"></span>');

                $(".renk a").click(function () {
                    //var x = '#' + $(this).attr('Data');
                    //$(x).val = $(this).html();
                    $("#<%=ddlRenk.ClientID%>").val(this.id);
                    $("#<%=ddlRenk.ClientID%>").trigger("change");
                });

                $(".desen a").click(function () {

                    $("#<%=ddlDesen.ClientID%>").val(this.id);
                    $("#<%=ddlDesen.ClientID%>").trigger("change");
                });

                $(".deri a").click(function () {

                    $("#<%=ddlDeriCesidi.ClientID%>").val(this.id);
                    $("#<%=ddlDeriCesidi.ClientID%>").trigger("change");
                });

                $(".cantaturu a").click(function () {

                    $("#<%=ddlCantaCesidi.ClientID%>").val(this.id);
                    $("#<%=ddlCantaCesidi.ClientID%>").trigger("change");
                });

                $(".sira a").click(function () {

                    $("#<%=ddlSiralama.ClientID%>").val(this.id);
                    $("#<%=ddlSiralama.ClientID%>").trigger("change");
                });
            });
        });

    </script>
    </asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div class="duzen"></div>
  <section>
  <div id="govde-kapsam">

    <div class="kategori-urun-filtreleme">
    <div class="filtreleme">
            
        <asp:DropDownList ID="ddlDesen" runat="server" AutoPostBack="True" style="display:none"> </asp:DropDownList>
        <asp:DropDownList ID="ddlCantaCesidi" runat="server"  AutoPostBack="True" style="display:none"> </asp:DropDownList>    
        <asp:DropDownList ID="ddlDeriCesidi" runat="server"  AutoPostBack="True" style="display:none"> </asp:DropDownList>    
        <asp:DropDownList ID="ddlSiralama" runat="server"  AutoPostBack="True" style="display:none">
            <asp:ListItem Value="-1">Sıralama</asp:ListItem>
            <asp:ListItem Value="1">Ucuzdan Pahalıya</asp:ListItem>
            <asp:ListItem Value="2">Pahalıdan Ucuza</asp:ListItem>
            <asp:ListItem Value="3">Ziyaret Sayısına G&#246;re</asp:ListItem>
        </asp:DropDownList>     
        <asp:DropDownList ID="ddlRenk" runat="server" AutoPostBack="True" style="display:none"> </asp:DropDownList>
                
        <div class="btn-group show-on-hover">
          <button id="btncantatipi" type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
            <asp:Label ID="lblCantaTuru" runat="server" /><span class="caret"></span>
          </button>
          <ul class="dropdown-menu" role="menu">          

            <asp:ListView ID="listCantaTuru" runat="server" DataSourceID="dsCantaTuru" >
                <ItemTemplate>
                    <li class="cantaturu"><a href="#" id='<%# Eval( "CantaTuruId") %>' Data='<%=  ddlCantaCesidi.ClientID  %>' ><%#Eval( "CantaTuruAdi")%></a></li>
              </ItemTemplate>
            </asp:ListView>
            <asp:SqlDataSource ID="dsCantaTuru" runat="server" ConnectionString="<%$ ConnectionStrings:Skala %>" SelectCommand="GetCantaTuru" SelectCommandType="StoredProcedure">

                  <SelectParameters>
                      <asp:CookieParameter CookieName="dil" DefaultValue="TR" Name="Dil" Type="String"></asp:CookieParameter>
                  </SelectParameters>
              </asp:SqlDataSource>

        </ul>
        </div>

        <div class="btn-group show-on-hover">
          <button id="btnRenk" type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
            <asp:Label ID="lblRenk" runat="server" /><span class="caret"></span>
          </button>
          <ul class="dropdown-menu" role="menu">
            
              <asp:ListView ID="listRenk" runat="server" DataSourceID="dsRenk" >
                <ItemTemplate>
                    <li class="renk"><a href="#" id='<%# Eval( "RenkId") %>' Data='<%=  ddlRenk.ClientID  %>' ><%#Eval( "Renk")%></a></li><%--href='Kategori.aspx?RenkId=<%# Eval( "RenkId") %>'--%>
              </ItemTemplate>
            </asp:ListView>
              <asp:SqlDataSource ID="dsRenk" runat="server" ConnectionString="<%$ ConnectionStrings:Skala %>" SelectCommand="GetRenk" SelectCommandType="StoredProcedure">

                  <SelectParameters>
                      <asp:CookieParameter CookieName="dil" DefaultValue="TR" Name="Dil" Type="String"></asp:CookieParameter>
                  </SelectParameters>
              </asp:SqlDataSource>

          </ul>
        </div>
        <div class="btn-group show-on-hover">

        <button id="btnDesen" type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
            <asp:Label ID="lblDesen" runat="server" /><span class="caret"></span>
          </button>
          <ul class="dropdown-menu" role="menu">
            
              <asp:ListView ID="listDesen" runat="server" DataSourceID="dsDesen" >
                <ItemTemplate>
                    <li class="desen"><a href="#" id='<%# Eval( "DesenId") %>' Data='<%=  ddlDesen.ClientID  %>' ><%#Eval( "Desen")%></a></li>
              </ItemTemplate>
            </asp:ListView>
            <asp:SqlDataSource ID="dsDesen" runat="server" ConnectionString="<%$ ConnectionStrings:Skala %>" SelectCommand="GetDesen" SelectCommandType="StoredProcedure">

                  <SelectParameters>
                      <asp:CookieParameter CookieName="dil" DefaultValue="TR" Name="Dil" Type="String"></asp:CookieParameter>
                  </SelectParameters>
              </asp:SqlDataSource>

          </ul>

        </div>
        <div class="btn-group show-on-hover">
          <button id="btndericesidi" type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
            <asp:Label ID="lblDeriCesidi" runat="server" /><span class="caret"></span>
          </button>
          <ul class="dropdown-menu" role="menu">
            
              <asp:ListView ID="listDeri" runat="server" DataSourceID="dsDeri" >
                <ItemTemplate>
                    <li class="deri"><a href="#" id='<%# Eval( "DeriCesidiId") %>' Data='<%=  ddlDeriCesidi.ClientID  %>' ><%#Eval( "DeriCesidiAdi")%></a></li>
              </ItemTemplate>
            </asp:ListView>
            <asp:SqlDataSource ID="dsDeri" runat="server" ConnectionString="<%$ ConnectionStrings:Skala %>" SelectCommand="GetDeriCesidi" SelectCommandType="StoredProcedure">

                  <SelectParameters>
                      <asp:CookieParameter CookieName="dil" DefaultValue="TR" Name="Dil" Type="String"></asp:CookieParameter>
                  </SelectParameters>
              </asp:SqlDataSource>

          </ul>
        </div>
        <div class="btn-group show-on-hover">
          <button id="btnsira" type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
            <asp:Label ID="lblFiyat" runat="server" /><span class="caret"></span>
          </button>
          <ul class="dropdown-menu" role="menu">
            <li class="sira"><a href="#" id="-1"><asp:Label ID="lblSiralama" runat="server" /></a></li>
            <li class="sira"><a href="#" id="1"><asp:Label ID="lblUcuzPahali" runat="server" /></a></li>
            <li class="sira"><a href="#" id="2"><asp:Label ID="lblPahaliUcuz" runat="server" /></a></li>
            <li class="sira"><a href="#" id="3"><asp:Label ID="lblZiyaret" runat="server" /></a></li>
          </ul>
        </div>
  </div>
  </div>

    <div id="govde-sol-kapsam">
      <div class="sol-menu-kategori">
        <h2 class="baslik-h2"><asp:Label ID="lblBayanCanta" runat="server" /></h2>
        <nav>
          <ul class="kategori-link">
            <asp:ListView ID="listBayanKategori" runat="server" DataSourceID="BayanKategori" >
                <ItemTemplate>
                    <li class="Kategori" id='kategori<%# Eval( "KategoriId") %>' Data="<%#Eval( "KategoriAdi")%>"><a href='<%# Page.GetRouteUrl("Kategori", new  {AnaKategoriId=-1,KategoriId=Eval( "KategoriId"),KategoriAdi=Temizle.UrlCevir(Eval( "KategoriAdi").ToString()) })%>'><%#Eval( "KategoriAdi")%></a></li>
              </ItemTemplate>
            </asp:ListView>
            <asp:SqlDataSource ID="BayanKategori" runat="server" ConnectionString="<%$ ConnectionStrings:Skala %>" SelectCommand="GetKategoriBayan" SelectCommandType="StoredProcedure">
                  <SelectParameters>
                      <asp:CookieParameter CookieName="dil" DefaultValue="TR" Name="Dil" Type="String"></asp:CookieParameter>
                  </SelectParameters>
            </asp:SqlDataSource>
          </ul>
        </nav>
      </div>
      <div class="duzen"></div>
      <div class="sol-menu-kategori">
        <h2 class="baslik-h2"><asp:Label ID="lblErkekCanta" runat="server" /></h2>
        <nav>
          <ul class="kategori-link">
            <asp:ListView ID="listErkekKategori" runat="server" DataSourceID="ErkekKategori" >
                <ItemTemplate>
                    <li class="Kategori" id='kategori<%# Eval( "KategoriId") %>' Data="<%#Eval( "KategoriAdi")%>"><a href='<%# Page.GetRouteUrl("Kategori", new  {AnaKategoriId=-1,KategoriId=Eval( "KategoriId"),KategoriAdi=Temizle.UrlCevir(Eval( "KategoriAdi").ToString()) })%>''><%#Eval( "KategoriAdi")%></a></li>
              </ItemTemplate>
            </asp:ListView>
            <asp:SqlDataSource ID="ErkekKategori" runat="server" ConnectionString="<%$ ConnectionStrings:Skala %>" SelectCommand="GetKategoriErkek" SelectCommandType="StoredProcedure">
                  <SelectParameters>
                      <asp:CookieParameter CookieName="dil" DefaultValue="TR" Name="Dil" Type="String"></asp:CookieParameter>
                  </SelectParameters>
            </asp:SqlDataSource>
          </ul>
        </nav>
      </div>
    </div>
    <!--GÖVDE ORTA KAPSAM-->
    <div id="govde-orta-kapsam">
      <div class="kategori-urun-baslik">
        <h2><asp:Label ID="lblSectiklerimiz" runat="server" /></h2>
        <div> 

            
    <asp:HiddenField   ID="hidCantaDurumu" runat="server" Value="0" />
    <asp:HiddenField   ID="hidUrunId" runat="server" Value="0" />
    <asp:Button Style="display:none;"  ID="btnCantayaEkle" runat="server" UseSubmitBehavior="false"  OnClick="btnCantayaEkle_Click" Text="Button" />
    <asp:Button Style="display:none;"  ID="btnHelper" runat="server" UseSubmitBehavior="false"  OnClick="btnHelper_Click" Text="Button" />
    <asp:ListView ID="listCanta" runat="server"  DataSourceID="Urunler" >
        <ItemTemplate >
          <!--ÜRÜN ANA KAPSAM--> 
          <!-- 1 ÜRÜN KAPSAM -->
          <div class="urun-dis-kapsam">
            <div class="urun-kapsam">
              <div>
                <div class="tovar_item">
                  <div class="tovar_img">
                    <div class="tovar_img_wrapper"> <img class="img" src='/urunler/<%# Eval( "OrtancaResimAdi") %>' alt="Ürün bilgi" title="Ürün başlık" /> 
                        <img class="img_h" src="/images/urun-golge.jpg" alt="" /> </div>
                    <div class="urun-adi"><%#Eval( "UrunKodu")%></div>
                    <div class="urun-kampanya-turu-bilgisi"><%#Eval( "KampanyaAdi")%></div>
                    <div class="tovar_item_btns"> 
                      <%--<a id="A1" class="add_lovelist"  runat="server" onserverclick= "Guncelle" Data='<%#Eval( "UrunId")%>'>  --%>
                        <a class="<%#Eval( "KalpSimgesi")%>" href="#" onclick="Begen('<%= btnHelper.ClientID  %>','<%#Eval( "UrunId")%>','<%= hidUrunId.ClientID  %>');">
                         <i class="fa fa-heart kalp-3"   ></i>                         
                      </a> 
                        <a class="add_bag" href='<%# Page.GetRouteUrl("Urun",new {UrunId = Eval( "UrunId"),UrunAdi=Temizle.UrlCevir(Eval( "UrunAdi").ToString()) }) %>' ><i class="fa fa-search buyutec-3"></i></a></div>
                  </div>
                  <div class="urun-fiyati"><%#Eval( "Fiyat")%></div>
                  <div class="urun-fiyat-eski"><%#Eval( "EskiFiyat")%></div>
                  <div class="urun-satin-alma-dugmeleri clearfix">
                    <ul>
                      <li><a href='<%# Page.GetRouteUrl("TeslimatAdresi",new {UrunId = Eval( "UrunId")}) %>'><%#Eval( "HizliAl")%></a></li>
                      <li><a href="#" onclick="CantayaEkle('<%#Eval( "UrunId")%>','<%#Eval( "CantaDurumu")%>');"><%#Eval( "CantaAciklama")%><%#Eval( "CantaSimgesi")%></a></li>
                    </ul>
                  </div>
                </div>
              </div>
              <div class='<%#Eval( "KampanyaMi")%>'></div>
              <div class='<%#Eval( "YeniMi")%>'></div>
            </div>
          </div>
          <!-- //1 ÜRÜN KAPSAM -->  
            </ItemTemplate>
            </asp:ListView>
<asp:SqlDataSource ID="Urunler" runat="server" ConnectionString="<%$ ConnectionStrings:Skala %>" SelectCommand="GetUrunler" SelectCommandType="StoredProcedure">
<SelectParameters>
    <asp:QueryStringParameter DefaultValue="-1" Name="UrunId" QueryStringField="UrunId" Type="Int32" />
    <%--<asp:QueryStringParameter DefaultValue="-1" Name="AnaKategoriId" QueryStringField="AnaKategoriId" Type="Int32" />--%>
    <asp:RouteParameter RouteKey="AnaKategoriId" DefaultValue="-1" Name="AnakategoriId" Type="Int32"></asp:RouteParameter>
    <%--<asp:QueryStringParameter DefaultValue="-1" Name="KategoriId" QueryStringField="KategoriId" Type="Int32" />--%>
    <asp:RouteParameter RouteKey="KategoriId" DefaultValue="-1" Name="kategoriId" Type="Int32"></asp:RouteParameter>
    <asp:ControlParameter ControlID="ddlCantaCesidi" DefaultValue="-1" Name="cantaTuruId" PropertyName="SelectedValue" Type="Int32" />
    <asp:ControlParameter ControlID="ddlDeriCesidi" DefaultValue="-1" Name="deriCesidiId" PropertyName="SelectedValue" Type="Int32" />
    <asp:ControlParameter ControlID="ddlRenk" DefaultValue="-1" Name="RenkId" PropertyName="SelectedValue" Type="Int32" />
    <asp:ControlParameter ControlID="ddlDesen" DefaultValue="-1" Name="DesenId" PropertyName="SelectedValue" Type="Int32" />
    <%--<asp:QueryStringParameter DefaultValue=" " Name="UrunAdi" QueryStringField="Ara" Type="String" />--%>
    <asp:RouteParameter RouteKey="UrunAdi" DefaultValue=" " Name="UrunAdi" Type="String"></asp:RouteParameter>
    <asp:ControlParameter ControlID="ddlSiralama" DefaultValue="-1" Name="Siralama" PropertyName="SelectedValue" Type="Int32" />
    <asp:SessionParameter DefaultValue="-1" Name="UyeId" SessionField="UyeId" Type="Int32" />
    <asp:CookieParameter CookieName="dil" DefaultValue="TR" Name="Dil" Type="String"></asp:CookieParameter>
</SelectParameters>
        </asp:SqlDataSource>                 
        </div>
      </div>
      <!--SAYFALAMA-->
      <div class="urun-sayfalama-kapsam">
          <ul class="pagination">
            <li>
          <asp:DataPager ID="lvDataPager1" runat="server" PagedControlID="listCanta" PageSize="12">
                <Fields>
                    <asp:NumericPagerField ButtonType="Link" />
                </Fields>            
            </asp:DataPager> 
            </li> 
        </ul>
        <%--<ul class="pagination">
          <li><a href="#">&laquo;</a></li>
          <li class="active"><a href="#">1</a></li>
          <li><a href="#">2</a></li>
          <li><a href="#">3</a></li>
          <li><a href="#">4</a></li>
          <li><a href="#">5</a></li>
          <li><a href="#">&raquo;</a></li>
        </ul>--%>
      </div>
      <!--//SAYFALAMA--> 
    </div>
    <!--//GÖVDE ORTA KAPSAM-->
    <div id="govde-sag"></div>
  </div>
 </section>
</asp:Content>   

